﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleGame.ScreenManagement.Screens
{
    public class OptionsScreen : MenuScreen
    {

        #region Constructor

        public OptionsScreen()
            : base("Options")
        {
            // Create menu items
            MenuItem backMenuItem = new MenuItem("Back");

            // Hook up menu event handlers
            backMenuItem.Selected += OnCancel;

            // Add items to the mneu
            menuItems.Add(backMenuItem);
        }

        #endregion

        #region Event Handlers

        /// <summary>
        /// When the user cancels the options menu, he goes back to the main menu.
        /// </summary>
        protected override void OnCancel(object sender, EventArgs e)
        {
            screenManager.AddScreen(new MainMenuScreen());
            screenManager.RemoveScreen(this);
        }

        #endregion
    }
}
